package com.eflow.engine.service;

import com.eflow.engine.vo.PassPathVo;
import com.eflow.engine.vo.ProcessVo;
import com.eflow.engine.vo.StartProcessInstanceVo;
import org.flowable.engine.runtime.ProcessInstance;

import java.util.List;

/**
 * @author hui se
 * @description 流程接口
 * @create 2021-02-24 18:09
 **/
public interface IProcessService {

    /**
     * 通过Key发起流程,需要先调用identityService.setAuthenticatedUserId() 设置当前登录用户的Id
     * @param params
     * @return
     */
    ProcessInstance startProcessInstanceByKey(StartProcessInstanceVo params);
    /**
     * 通过Id发起流程,需要先调用identityService.setAuthenticatedUserId() 设置当前登录用户的Id
     * @param params
     * @return
     */
    ProcessInstance startProcessInstanceById(StartProcessInstanceVo params);

    /**
     * 获取流程经过的节点，目前只是获取节点ID,后期要添加任务审批人时间等
     * @param processInstanceId
     * @return
     */
    PassPathVo getPassPath(String processInstanceId);

    /**根据流程实例Id获取流程xml
     * @param processInstanceId
     * @return
     */
    ProcessVo getProcessXmlByProcessInstanceId(String processInstanceId);

    /**根据流程定义Id获取流程xml
     * @param ProcessDefinitionId
     * @return
     */
    ProcessVo getProcessXmlByProcessDefinitionId(String ProcessDefinitionId);

    void deleteProcessInstance(String processInstanceId, String deleteReason);
}
